package Eyjafjalla.card.skill;

import Eyjafjalla.action.CloudCakeAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.BlurPower;

public class LiveStone_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "LiveStone_Eyjafjalla";
    private static final CardStrings cardStrings;

    public LiveStone_Eyjafjalla(){
        super(ID, cardStrings.NAME,4,cardStrings.DESCRIPTION,CardType.SKILL,CardRarity.UNCOMMON,CardTarget.SELF);
        this.baseBlock = 40;
        this.block = 40;
        this.baseMagicNumber = 1;
        this.magicNumber = 1;
        this.exhaust = true;
        this.selfRetain = true;
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new LiveStone_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new GainBlockAction(p,block));
        addToBot(new ApplyPowerAction(p,p,new BlurPower(p,this.magicNumber),this.magicNumber));
    }

    @Override
    public void applyPowers() {
        int trueM = baseMagicNumber;
        if(isFire()){
            baseMagicNumber+=1;
        }
        magicNumber = baseMagicNumber;
        baseMagicNumber = trueM;
        isMagicNumberModified = baseMagicNumber!=magicNumber;
        super.applyPowers();
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeBlock(16);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}


